<?

class Cache {

    private static $instance;

    public static function getInstance() {

        if(self::$instance === null) {

            require_once 'Zend/Cache.php';

            $frontendOptions = array(
               'lifetime' => 60 * 60 * 24 * 356, // cache lifetime of 1 year
               'automatic_serialization' => false
            );

            $backendOptions = array(
                'cache_dir' => BASEPATH . "/_cache/" // Directory where to put the cache files
            );

            // getting a Zend_Cache_Core object
            self::$instance = Zend_Cache::factory('Output', 'File', $frontendOptions, $backendOptions);

        }

        return self::$instance;

    }


}